text = input()
words = ''
for char in text:
    if char.isalpha():
        words += char.lower()
    else:
        words += ' '

word_list = words.split()
word_count = {}

for word in word_list:
    if word in word_count:
        word_count[word] += 1
    else:
        word_count[word] = 1

max_count = max(word_count.values())
max_words = [word for word, count in word_count.items() if count == max_count]

print(max_count)
for word in sorted(max_words):
    print(word)
